Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored watchable_args and build_original_fullpath methods in Rails::Application #4470

Merged
merged 1 commit into from Jan 15, 2012

Conversation

ndbroadbent
Copy link
Contributor

Inspired by line notes on fa1d9a8.

josevalim added a commit that referenced this pull request Jan 15, 2012
Refactored watchable_args and build_original_fullpath methods in Rails::Application
@josevalim josevalim merged commit 09c4f0a into rails:master Jan 15, 2012
else
"#{script_name}#{path_info}"
end
["#{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}", env["QUERY_STRING"]].reject(&:blank?).join("?")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is harder to read than previous code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, would you prefer this instead?

def build_original_fullpath(env)
  script_and_path, query_string = "#{env['SCRIPT_NAME']}#{env['PATH_INFO']}", env['QUERY_STRING']
  query_string.present? ? "#{script_and_path}?#{query_string}" : script_and_path
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I prefer the original code, it's easier to read and has no excessively large lines of code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, no worries, reverted in pull request #4731

benjamineskola added a commit to alphagov/whitehall that referenced this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants